

<template>
    <div>
            <div  v-if="activeName=='1'">
                <div class="searcch">
            <div >
              <el-input
                v-model="params.patient_no"
                placeholder="请输入门诊号"
              ></el-input>
            </div>
            <div style="width:300px">
              <el-input
                v-model="params.member_name"
                placeholder="请输入患者姓名"
              ></el-input>
            
            </div>
            <div>
              <el-select v-model="params.status" placeholder="请选择挂号状态" @change="searchB">
                <el-option
                  v-for="(item,index) in $baseBai['mzsf']['gh_zt']"
                  :key="'index1'+index"
                  :label="item.label"
                  :value="item.value"

                >
                </el-option>
              </el-select>
            </div>
            <div>
              <el-select v-model="params.look_type" placeholder="请选择初复诊" @change="searchB">
                <el-option
                  v-for="(item,index) in $baseBai['mzsf']['gh_cfz']"
                  :key="'index2'+index"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
               <el-button  class="butB_Sel"  @click="searchB()">查询</el-button>
               <el-button class="butB_Reset" @click="resetSearchB()">重置</el-button>
              <el-button class="butB_Add"  @click="add()">新增挂号</el-button>
            </div>
            <div class="right"> 
               
            </div>
          </div>

          <div class="selectBai">
            
            <div>

                <el-cascader
                placeholder="请选择科室"
                :options="thatF.subjectData"
                @change="changeSubject"
                 v-model="doctor_dept"
                :props="{ checkStrictly: true,value:'id',label:'name' }"
                clearable></el-cascader>
               

            </div>
            <div>
             
 
 
                 <el-date-picker
              v-model="params.start_time"
              type="daterange"
              range-separator="-"
               @change="riqiSel"
                value-format="yyyy-MM-dd"
              start-placeholder="开始日期"
              end-placeholder="结束日期">
            </el-date-picker>
            </div>
          </div>
            </div>
            <div v-if="activeName=='2'" style="width: 500px;">
               <div style="width: 300px;display: flex;">
              <el-input
                v-model="params.keyword"
                placeholder="请输入患者姓名"
              ></el-input>
              <el-button class="butB_Sel" style="margin-left:20px;margin-bottom:20px"   @click="searchB()">查询</el-button>
                            <el-button class="butB_Sel" style="margin-left:20px;margin-bottom:20px"   @click="daochu()">导出</el-button>
            </div>
                <div class="selectBai">
                  <div>
             
 

                 <el-date-picker
              v-model="params.start_time"
              type="daterange"
              range-separator="-"
               @change="riqiSel"
                value-format="yyyy-MM-dd"
              start-placeholder="开始日期"
              end-placeholder="结束日期">
            </el-date-picker>
            </div>
                </div>
            </div>
    </div>
</template>
<script>
import {http} from "@/utils/server.js"
import {clinic_fee_exportToExcel} from "@/api/zhuyanre"
export default {
   props:['params','activeName','showAddUpdate','thatF','dialogStatus'],
    data() {
        return {
          doctor_dept:'',
        } 
    },
    methods:{

      daochu(){
             var d={
            start_time:this.params.start_time ? ((this.params.start_time.toString()).replace(',', '|')).toString() : '',
          }
      clinic_fee_exportToExcel(d)
      .then(res=>{
        window.open(http + '/' +res.data.file_url);
      }) 
      .catch(e=>{
        this.$message({
          message:e.message,
          type: 'error'
        });
      })
      },
      resetSearchB(){
        this.doctor_dept='';
          this.$emit('resetSearchB');
      },
      add(){
         
          this.$emit('dialogStatus');
      },
      riqiSel(e){
        let t=this; 
          console.log("进来安利1吗",e)
  
         t.thatF.params.page=1;
          if(t.thatF.activeName=='1'){
               this.$emit('selectGetList');
          }else if(t.thatF.activeName=='2'){
             
              t.thatF.getClinic_feeFeeIndex()
            }
      
      },
     
    
      changeSubject(e){
     
           this.thatF.params.page=1;
     
         this.thatF.params.doctor_dept=e[e.length-1]
           this.$emit('selectGetList');
      },
      searchB(){
        let t=this;
        console.log("t.thatF.activeName",t.thatF.activeName)
          if(t.thatF.activeName=='1'){
             this.$emit('selectGetList');
          }else if(t.thatF.activeName=='2'){
            t.thatF.params.page=1;
            t.thatF.getClinic_feeFeeIndex()
          }
        
         
        // this.$parent.search();
      },

   
    },

}
</script>
<style lang='scss' scoped>


/deep/ .el-tabs__item.is-active{
    color: #42b983;
  }
  
  .searcch{
  
    margin: 0px 0 20px 0;
    display: flex;
    >div{
      display: flex;
       margin-right: 20px;
      button{
        margin-left: 20px;
      }
      
    }
    .right{
      flex: 1;
      justify-content: flex-end;
    }
  
  }
  
  /deep/ .el-button--success{
    background: #02bf6b;
    border-color: #02bf6b; 
    color: white;
  }
  
  .boxs{
    margin:20px 10%;
  }
  .selectBai{
    display: flex;
    margin-bottom: 20px;
    >div{
      margin-right: 20px;
    }
  }
  /deep/ .el-dialog{
    width: 60%;
  }
</style>